package com.example.reflect.springannotation.controller;

import com.example.reflect.springannotation.config.CommonStrategy;
import com.example.reflect.springannotation.enums.StrategyEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController()
@RequestMapping("/home")
public class StrategyController {

    @Autowired
    public CommonStrategy commonStrategy;

    @GetMapping("/index/{key}")
    public String inde(@PathVariable("key") String key){
        Object o = commonStrategy.executeScheduler(StrategyEnum.getEnum(key),"S","O");
        return "当前执行的的策略key：" + key;
    }
}
